<!--Author: Amr Tj.Wallas-->
<!--Task: C1S23-->
#{extends 'Secure/layout.html' /}
#{set title:'Delete Me' /}
<script type="text/javascript">
	function showz(){
		var check = $('#check').attr('checked');
		//prompt(check);
		if(check)
		$('#delete').show();
		else
		$('#delete').hide();
	}
	function undo_req(){
		window.location.replace('@{undoRequest()}');
	}
</script>

	
	<h1><p align="center">Deletion Request</p></h1>
	<!--Show an error from the controller if any-->
	#{ifErrors}
		<p class="error left">
		    #{errors}
		    	${error}<br />
		    #{/errors}
		    </p>
		#{/ifErrors}
		#{if flash.error}
			<p class="error left">&{flash.error}</p>
		#{/if}
		<!--Show success messages from the controller if any-->
		#{if flash.success}
			<p class="success">&{flash.success}</p>
		#{/if}
	<br /> <br />
	#{if !user}
	<h2><u> WARNING !!!</u></h2>
	<p align="justify"><font color="red" size="4"><b>
		By Requesting to be deleted from the system, you should be aware of the following:<br />
		- You will no longer be able to Access the system or login with your account.<br />
		- Your profile will not be visible to other users.<br />
		- All you contributions in projects will presist and will remain visible by project members.<br />
		- You will no longer be able to view projects or contact users through the system.<br />
		- You will no longer recieve any emails or notifications from us.<br />
		- You will not be able to undo such action and would need to contact us if you need your account back.<br />
		
	</b></font></p>
	<p align="center">
	<INPUT TYPE=CHECKBOX id = "check" onchange = "showz();">&nbsp;
	I HAVE CAREFULLY READ THE ABOVE WARNING AND I STILL WANT TO DELETE MY ACCOUNT</p>
	<!--The Registration form element-->
	<div id="login">
		
	<form name = "delete" id = "delete" action = "@{deletionRequest()}" method="post" style="display:none">
		
		<p align = "center"><b><u>Please Confirm By Entering your password:</u></b></p>
		<p class="form-field">
			<label>Password</label>
			<input type="password" name="pwd" id="firstname" value="${flash.pwd}"/>
		</p>
		
		<p id="submission-field" align="center">
			<input type = "submit" value = "Submit" /> 
		</p>
	</form> 
	
</div>
#{/if}
#{else}
<font size="4">
	Hey ${user.name}, It seems like you have already filed a deletion request.<br />
	<a href="#" onclick="undo_req();">Undo that Request?</a>
#{/else}
